/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Validator;

import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author Adjell Ian
 */
public class CustomerValidator {

    private Pattern pattern;
    private Matcher matcher;
    private boolean found = true;

    public boolean validateuser(String string) {
        try {
            pattern = Pattern.compile("^[a-z0-9@.-_+]$", Pattern.CASE_INSENSITIVE);
            matcher = pattern.matcher(string);

            found = matcher.find();
        } catch (Exception e) {
            Logger.getLogger(CustomerValidator.class.getName()).log(Level.SEVERE, null, e);
        }
        return found;
    }
}
